<?php

namespace App\Services;

use App\Common\Libs\Dispatch\Queue;
use App\Consts\GlobalQueueConst;
use App\Jobs\Controller\BrowseHistoryJob;

class BrowseHistoryService extends BaseService
{
    private $_repository;

    public function __construct()
    {
        parent::__construct();
        $this->_repository = repository()->BrowseHistoryRepository;
    }

    /**
     * 新增浏览历史记录
     * @param $loadData
     * @return \Illuminate\Foundation\Bus\PendingDispatch
     */
    public function createByQueue($loadData)
    {
        return Queue::getInstance(BrowseHistoryJob::class)
            ->push($loadData, GlobalQueueConst::BROWSER_HISTORY_CREATE);
    }
}
